# 获取面单(非智能订单)
接口地址: http://www.damaijia168.com/vv/external/pinForSurfaceSingleFzn
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| shopCode | string | 是 | 电子面单商家账户 token |
| senderAddress | string | 是 | 发件人详细地址 |
| orderNo | string | 是 | 订单号 |
| goodsInfoList | array | 是 | 礼品信息 |
| ----goodsCount | string | 是 | 礼品数量 |
| ----goodsId | string | 是 | 礼品 id |
| ----goodsName | string | 是 | 礼品名称 |
| ----goodsWeight | string | 是 | 重量 |
| ----receiverName | string | 是 | 收件人姓名 |
| ----senderDistrict | string | 是 | 发件人区县 |
| ----receiverProvince | string | 是 | 收件人省份 |
| ----senderProvince | string | 是 | 发件人省份 |
| ----receiverCity | string | 是 | 收件人市 |
| ----senderCity | string | 是 | 发件人市 |
| ----waybillSellerNick | string | 是 | 主账号 |
| ----templateUrl | string | 是 | 模板路径 |
| ----receiverAddress | string | 是 | 收件人详细地址 |
| ----senderPhone | string | 是 | 发件人号码 |
| ----senderName | string | 是 | 发件人姓名 |
| ----receiverPhone | string | 是 | 收件人号码 |
| ----receiverDistrict | string | 是 | 收件人区 |
| ----wpCode | string | 是 | 快递编号 |
# 请求示例
{
"shopCode": "SaX*********lpraw==",
"senderAddress": "**区**公寓",
"orderNo": "1********3",
"goodsInfoList": {
"goodsCount": "1",
"goodsId": "12",
"goodsName": "还好",
"goodsWeight": "20",
"receiverName": "大哥",
"senderDistrict": "**省",
"receiverProvince": "河北",
"senderProvince": "**省",
"receiverCity": "**市",
"waybillSellerNick": "55622665XXX",
"templateUrl": "http://cloudprint.cainiao.co********0659/40",
"receiverAddress": "**省**区",
"senderPhone": "12********01",
"senderName": "测试",
"receiverPhone": "123********1",
"receiverDistrict": "**区",
"wpCode": "WTO"
}
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/pinForSurfaceSingleFzn' --header 'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx' --header 'Content-Type: application/json' --data-raw '{
"shopCode": "SaX*********lpraw==",
"senderAddress": "**区**公寓",
"orderNo": "1********3",
"goodsInfoList": {
"goodsCount": "1",
"goodsId": "12",
"goodsName": "还好",
"goodsWeight": "20",
"receiverName": "大哥",
"senderDistrict": "**省",
"receiverProvince": "河北",
"senderProvince": "**省",
"receiverCity": "**市",
"waybillSellerNick": "55622665XXX",
"templateUrl": "http://cloudprint.cainiao.co********0659/40",
"receiverAddress": "**省**区",
"senderPhone": "12********01",
"senderName": "测试",
"receiverPhone": "123********1",
"receiverDistrict": "**区",
"wpCode": "WTO"
}
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/pinForSurfaceSingleFzn',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"shopCode": "SaX*********lpraw==",
"senderAddress": "**区**公寓",
"orderNo": "1********3",
"goodsInfoList": {
"goodsCount": "1",
"goodsId": "12",
"goodsName": "还好",
"goodsWeight": "20",
"receiverName": "大哥",
"senderDistrict": "**省",
"receiverProvince": "河北",
"senderProvince": "**省",
"receiverCity": "**市",
"waybillSellerNick": "55622665XXX",
"templateUrl": "http://cloudprint.cainiao.co********0659/40",
"receiverAddress": "**省**区",
"senderPhone": "12********01",
"senderName": "测试",
"receiverPhone": "123********1",
"receiverDistrict": "**区",
"wpCode": "WTO"
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"shopCode\": \"SaX*********lpraw==\",\r\n \"senderAddress\": \"**区**公寓\",\r\n \"orderNo\": \"1********3\",\r\n \"goodsInfoList\": {\r\n \"goodsCount\": \"1\",\r\n \"goodsId\": \"12\",\r\n \"goodsName\": \"还好\",\r\n \"goodsWeight\": \"20\",\r\n \"receiverName\": \"大哥\",\r\n \"senderDistrict\": \"**省\",\r\n \"receiverProvince\": \"河北\",\r\n \"senderProvince\": \"**省\",\r\n \"receiverCity\": \"**市\",\r\n \"waybillSellerNick\": \"55622665XXX\",\r\n \"templateUrl\": \"http://cloudprint.cainiao.co********0659/40\",\r\n \"receiverAddress\": \"**省**区\",\r\n \"senderPhone\": \"12********01\",\r\n \"senderName\": \"测试\",\r\n \"receiverPhone\": \"123********1\",\r\n \"receiverDistrict\": \"**区\",\r\n \"wpCode\": \"WTO\"\r\n }\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/pinForSurfaceSingleFzn")
.method("POST", body)
.addHeader("Authorization", "1798c6aadec33d1bc2f5b707f1049aefexxxx")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
import json
url = "http://www.damaijia168.com/vv/external/pinForSurfaceSingleFzn"
payload = json.dumps({
"shopCode": "SaX*********lpraw==",
"senderAddress": "**区**公寓",
"orderNo": "1********3",
"goodsInfoList": {
"goodsCount": "1",
"goodsId": "12",
"goodsName": "还好",
"goodsWeight": "20",
"receiverName": "大哥",
"senderDistrict": "**省",
"receiverProvince": "河北",
"senderProvince": "**省",
"receiverCity": "**市",
"waybillSellerNick": "55622665XXX",
"templateUrl": "http://cloudprint.cainiao.co********0659/40",
"receiverAddress": "**省**区",
"senderPhone": "12********01",
"senderName": "测试",
"receiverPhone": "123********1",
"receiverDistrict": "**区",
"wpCode": "WTO"
}
})
headers = {
'Authorization': '1798c6aadec33d1bc2f5b707f1049aefexxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| ----orderNo | string | 订单号 |
| ----printData | string | 打印数据 |
| ----waybillNo | string | 面单号 |
| ----amount | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data":{"orderNo":"1*********3",
"printData":"打印成功",
"waybillNo":"7********3"},
"status": 0
}
# 错误码
| 状态码(status)) | 错误说明 |
|---|---|
| 1003 | 用户不存在 |
| 132 | 请求格式必须为JSON |
| 422 | 参数列表不合法,在err中会给出提示 |
| 200 | 认证失败 |
| 202 | 商品id不合法 |
| 203 | 仓库id不合法 |
| 228 | 订单来源不合法 |
| 217 | 创建订单失败 |
| 212 | 包裹id不合法 |
| 209 | 账户余额不足 |